var chai = require('chai');
var assert = chai.assert;
var expect = chai.expect;
var utils = require('../utils.js')


describe('utils', function() {
	describe('#getFullUrl', function() {
		var getFullUrl = utils.getFullUrl;
 
		it("url test A1", function() {
			expect(getFullUrl("http://a.b.com/", "foo.html")).to.equal("http://a.b.com/foo.html");
		})

		it("url test A2", function() {
			expect(getFullUrl("http://a.b.com/", "/foo.html")).to.equal("http://a.b.com/foo.html");
		})



		it("url test B1", function() {
			expect(getFullUrl("http://a.b.com/aa", "foo.html")).to.equal("http://a.b.com/foo.html");
		})

		it("url test B2", function() {
			expect(getFullUrl("http://a.b.com/aa/", "foo.html")).to.equal("http://a.b.com/foo.html");
		})

		it("url test B3", function() {
			expect(getFullUrl("http://a.b.com/aa/", "/foo.html")).to.equal("http://a.b.com/foo.html");
		})



		it("url test B4", function() {
			expect(getFullUrl("http://a.b.com/x/y", "foo.html")).to.equal("http://a.b.com/x/foo.html");
		})

		it("url test B5", function() {
			expect(getFullUrl("http://a.b.com/x/y", "/foo.html")).to.equal("http://a.b.com/foo.html");
		})
	});
});

// describe('utils', function() {
// 	describe('#getHrefInHtml', function() {

// 	});
// });